package com.example.smartcity.logic.utils

import android.app.Activity
import android.graphics.Point
import com.example.smartcity.SmartCityApplication.Companion.context
import com.example.smartcity.logic.utils.Toast.Companion.showToast

/**
 *
 *  ANDROID STUDIO -version 2022.19
 *  项目名: Display
 *  创建时间: 2023/2/10 23:26
 *  CodeAuthor: ikun
 *  email: 2506789532@qq.com
 **/
class Display {
    companion object{
        // 获取屏幕宽度
        fun getWidth(ac: Activity) : String{
            val display = ac.windowManager?.defaultDisplay
            val point = Point()
            display?.getSize(point)
            val width = display?.width
            return width.toString()
        }

        // 获取屏幕高度
        fun getHeight(ac: Activity) : String{
            val display = ac.windowManager?.defaultDisplay
            val point = Point()
            display?.getSize(point)
            val height = display?.height
            return height.toString()
        }
    }
}